Repository navigation
[docs] Document that undo recovery rolls back other writers' changes - #5331
Conversation
…on aggregation tables
…ection with an example
|
|
||
| ### Single Writer with Flink | ||
|
|
||
| A Flink job writing an aggregation table must be the table's only writer. On recovery, the job rolls back every change in each bucket since its last checkpointed write, including changes from other jobs or clients. Partitions created after the checkpoint are rolled back in full. |
There was a problem hiding this comment.
I'm not sure we need a “Single Writer with Flink” section. Aggregataion table is the same as regular primary-key tables, two Flink jobs can use partial updates to write the same key concurrently if they explicitly target disjoint non-key columns. FIP-21 assumes this case, and the recovery test checks that rolling back price preserves the other writer's update to stock. FIP-21, section 3 · Recovery test
Even on a regular primary-key table, two independent jobs writing the same column have no guaranteed write order and is not supported. If one writes (id=1, v=10) and the other writes (id=1, v=11), both writes can be acknowledged. The final value can be 10 or 11, depending on which write Fluss applies last.
cc @platinumhamburg what do you think?
There was a problem hiding this comment.
I agree with @wuchong. Let’s document the undo recovery behavior for full-row writes, as shown in #5330. Multiple Flink jobs can still use explicit partial updates on the same key when their non-key target columns don’t overlap. A table-wide single-writer requirement would rule out that supported case.
There was a problem hiding this comment.
Thanks @wuchong @platinumhamburg for your review, updated PR accordingly 🙏
|
Hi @wuchong @platinumhamburg - If you are happy with this doc submission, are you happy with the proposed rough approach for underlying issue in #5330 to be tackled as follow-up? |
platinumhamburg
left a comment
There was a problem hiding this comment.
Thanks @mcgrj for adding these explanations. The examples make the recovery behavior clear. Could we consider opening Exactly-Once Semantics with one sentence summarizing the conditions from FIP-21? For example:
Flink provides exactly-once writes to an aggregation table when a single Flink job is the only writer, or when multiple Flink jobs use explicit partial updates on non-overlapping sets of non-primary-key columns.
This would help readers immediately determine whether the guarantee applies to their setup, with the following examples explaining the implications. Currently, the general rule appears after the examples, so readers need to infer the conditions from the recovery behavior. Stating the rule first would make this section easier to follow.
|
Thanks @platinumhamburg, sounds good to me - I've made the requested addition for your review. |
Generative AI disclosure: Yes. Drafted with Grok Bot (AI assistant); reviewed and revised by @mcgrj.
Revision drafted with OpenAI Codex.
Generated-by: Grok Bot and OpenAI Codex following the guidelines
Purpose
Linked issue: Part of #5330
Document how restoring a Flink job that writes full rows can undo other writers' changes in the same bucket.
Brief change log
Explain the recovery window, show how restoring a checkpoint can delete a key inserted by another writer, and clarify support for explicit partial updates to disjoint non-key columns.
Tests
Docs-only change. Before this wording revision, the website build (
./build_versioned_docs.sh,./setup_blog.sh,npm run build -- --no-minify) passed locally. Pre-existing broken anchors remain; none are on the changed page.API and Format
No API or storage format change.
Documentation
This updates the existing aggregation merge engine documentation. It does not close #5330.